<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Symbol.html</title>
</head>
<body>

    <script>
        let s1 = Symbol();
        console.log(s1,typeof s1);
        let s2 = Symbol();
        console.log(s2,typeof s2);
        console.log(s1==s2);
        console.log("========================");
        let s3 = Symbol("小明");
        let s4 = Symbol("小明");
        console.log(s3,typeof s3);
        console.log(s4,typeof s4);
        console.log(s3 == s4);
        console.log("========================");
        /*
         对象：key 不能重复
        */
        const keyObj = {
            a:Symbol("name"),
            b:Symbol("name")
        }
        
        const  obj = {
            [keyObj['a']]:"小明",
            [keyObj['b']]:"小红"
        }

        console.log(obj);

        console.log(obj[keyObj['a']]);
    </script>
    
</body>
</html>